<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Hello Trae</title>
    <!-- 我们会在这里添加CSS样式 -->
    <style>
        /* 全局样式重置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        /* 基础样式 */
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: #333;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        /* 容器样式 */
        .container {
            background-color: white;
            border-radius: 20px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            padding: 40px;
            max-width: 600px;
            width: 100%;
            text-align: center;
            transition: transform 0.3s ease;
        }

        /* 标题样式 */
        .title {
            font-size: 3rem;
            margin-bottom: 10px;
            background: linear-gradient(45deg, #667eea, #764ba2);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .subtitle {
            font-size: 1.2rem;
            color: #666;
            margin-bottom: 30px;
        }

        /* Trae特殊样式 */
        .trae {
            position: relative;
            display: inline-block;
            animation: pulse 2s infinite;
        }

        /* 卡片样式 */
        .card {
            background-color: #f9f9f9;
            border-radius: 15px;
            padding: 30px;
            margin: 20px 0;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
        }

        .card p {
            font-size: 1.1rem;
            margin-bottom: 20px;
        }

        /* 按钮样式 */
        .btn {
            background: linear-gradient(45deg, #667eea, #764ba2);
            color: white;
            border: none;
            padding: 12px 30px;
            font-size: 1rem;
            border-radius: 30px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
        }

        .btn:active {
            transform: translateY(-1px);
        }

        /* 页脚样式 */
        footer {
            margin-top: 30px;
            font-size: 0.9rem;
            color: #888;
        }

        /* 动画效果 */
        @keyframes pulse {
            0% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.05);
            }
            100% {
                transform: scale(1);
            }
        }

        /* 震动动画 */
        @keyframes shake {
            0%, 100% {
                transform: translateX(0);
            }
            10%, 30%, 50%, 70%, 90% {
                transform: translateX(-5px);
            }
            20%, 40%, 60%, 80% {
                transform: translateX(5px);
            }
        }

        .shake {
            animation: shake 0.5s ease-in-out;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .container {
                padding: 30px 20px;
            }

            .title {
                font-size: 2.5rem;
            }

            .subtitle {
                font-size: 1rem;
            }
        }

        @media (max-width: 480px) {
            .title {
                font-size: 2rem;
            }

            .btn {
                padding: 10px 20px;
                font-size: 0.9rem;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <header>
            <h1 class="title">Hello <span class="trae">Trae</span></h1>
            <p class="subtitle">欢迎使用世界上最好的IDE</p>
        </header>
        
        <main>
            <div class="card">
                <p>这是一个简单的演示页面，展示Trae AI的强大功能。</p>
                <button class="btn">点击我</button>
            </div>
        </main>
        
        <footer>
            <p>&copy; 2024 Trae AI - 全栈开发专家和用户体验设计师</p>
        </footer>
    </div>

    <!-- 我们会在这里添加JavaScript -->
    <script>
        // 等待DOM加载完成
        document.addEventListener('DOMContentLoaded', function() {
            // 获取页面元素
            const button = document.querySelector('.btn');
            const container = document.querySelector('.container');
            const title = document.querySelector('.title');
            const card = document.querySelector('.card');
            
            // 定义一些颜色，用于随机切换背景
            const colors = [
                'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
                'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)',
                'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
                'linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)',
                'linear-gradient(135deg, #d299c2 0%, #fef9d7 100%)'
            ];
            
            // 定义一些问候语，用于点击按钮时切换
            const greetings = [
                'Hello Trae!',
                '你好，Trae！',
                '欢迎使用Trae AI！',
                'Trae，世界上最好的IDE！',
                '探索Trae的强大功能！'
            ];
            
            // 当前问候语索引
            let currentGreetingIndex = 0;
            
            // 按钮点击事件处理函数
            function handleButtonClick() {
                // 1. 容器轻微震动效果
                container.classList.add('shake');
                setTimeout(() => {
                    container.classList.remove('shake');
                }, 500);
                
                // 2. 切换背景颜色
                const randomColor = colors[Math.floor(Math.random() * colors.length)];
                document.body.style.background = randomColor;
                
                // 3. 更改问候语
                currentGreetingIndex = (currentGreetingIndex + 1) % greetings.length;
                // 创建新的文本内容，保留span标签
                const newText = greetings[currentGreetingIndex].replace('Trae', '<span class="trae">Trae</span>');
                title.innerHTML = newText;
                
                // 4. 卡片动画效果
                card.style.transform = 'scale(0.95)';
                setTimeout(() => {
                    card.style.transform = 'scale(1)';
                }, 200);
                
                // 5. 在控制台显示消息（开发者可以看到）
                console.log('按钮被点击了！');
            }
            
            // 添加按钮点击事件监听器
            button.addEventListener('click', handleButtonClick);
            
            // 添加鼠标悬停在容器上的效果
            container.addEventListener('mouseenter', function() {
                this.style.transform = 'translateY(-5px)';
            });
            
            container.addEventListener('mouseleave', function() {
                this.style.transform = 'translateY(0)';
            });
            
            // 添加页面加载时的淡入效果
            function fadeIn() {
                let opacity = 0;
                const interval = setInterval(() => {
                    opacity += 0.05;
                    container.style.opacity = opacity;
                    if (opacity >= 1) {
                        clearInterval(interval);
                    }
                }, 20);
            }
            
            // 初始化页面不透明度为0
            container.style.opacity = '0';
            container.style.transition = 'opacity 0.5s ease';
            
            // 调用淡入函数
            fadeIn();
        });
    </script>
</body>
</html>